package com.qf.day09.comparator;

import java.util.Arrays;
import java.util.Comparator;


public class Demo {
    public static void main(String[] args) {
        //创建对象
        Hero hero1 = new Hero("亚菲利欧",500,72);
        Hero hero2 = new Hero("瑞雯",550,80);
        Hero hero3 = new Hero("菲奥娜",500,72);
        Hero hero4 = new Hero("亚索",600,80);
        Hero hero5 = new Hero("赵信",600,60);
        //创建team数组
        Hero[]team1= {hero1,hero2,hero3,hero4,hero5};
        //遍历排序之前的数组
        System.out.println(Arrays.toString(team1));
        Arrays.sort(team1,new Comparato());
        //遍历排序之后的数组
        System.out.println(Arrays.toString(team1));

    }

}
